const filetool = {
    getUrlByBase64(base64,type){
        base64 = base64.replace(/[\n\r]/g, '')
        const raw = window.atob(base64)
        const rawLength = raw.length
        const uInt8Array = new Uint8Array(rawLength)
        for (let i = 0; i < rawLength; ++i) {
            uInt8Array[i] = raw.charCodeAt(i)
        }
        const url = window.URL.createObjectURL(new Blob([uInt8Array], { type: type }));
        return url;
    }
}

export default filetool;
